/**
 * 入驻商管理
 * @author xingzb
 * @date 2019-12-23
 */
import request from '@/utils/request'

// 获取 数据字典
export function getListDict(query) {
  return request({
    url: `/arpa-basic-api/dict/listDict`,
    method: 'get',
    params: query
  })
}
// ocr智能识别
export function getOcr(data) {
  return request({
    url: '/ntocc-tps-api/ocr/card',
    method: 'get',
    params: data
  })
}

// 获取 数据字典
export function verifyPayee(query) {
  return request({
    url: `/ntocc-tms-api/mybankPrepay/verifyPayee`,
    method: 'get',
    params: query
  })
}

// 获取 货物类型
export function getGoodsTypeDict(query) {
  return request({
    url: `/arpa-basic-api/goodsType`,
    method: 'get',
    params: query
  })
}

// 获取/查询 入驻商/企业/员工列表
export function getShipperList(query) {
  return request({
    url: `/arpa-basic-api/shipment`,
    method: 'get',
    params: query
  })
}


// 新增 入驻商/企业详情
export function addShipperInfo(data) {
  return request({
    url: `/arpa-basic-api/shipment`,
    method: 'post',
    data: data
  })
}

// 获取 企业/员工详情
export function getShipperInfo(code) {
  return request({
    url: `/arpa-basic-api/shipment/${code}`,
    method: 'get'
  })
}

// 获取 入驻商详情
export function getShipmentInfo() {
  return request({
    url: `/arpa-basic-api/shipment/shipmentInfo/`,
    method: 'get'
  })
}

// 更新 入驻商/企业详情
export function updateShipperInfo(data) {
  return request({
    url: `/arpa-basic-api/shipment`,
    method: 'put',
    data: data
  })
}

// 删除 指定入驻商/企业/员工
export function delShipperInfo(data) {
  return request({
    url: `/arpa-basic-api/shipment`,
    method: 'delete',
    params: data
  })
}
// 获取 合同列表
export function getShipmentContrctList(query) {
  return request({
    url: `/arpa-basic-api/shipmentContract`,
    method: 'get',
    params: query
  })
}
// 删除 合同
export function delShipmentContract(data) {
  return request({
    url: '/arpa-basic-api/shipmentContract',
    method: 'delete',
    params: data
  })
}

// 蚂蚁金融数字物流区块链接口
export function maYiBlockChain(code) {
  return request({
    url: `/ntocc-tms-api/maYiBlockChain/apply/${code}`,
    method: 'get'
  })
}

// 获取 发票列表
export function getInvoiceList(query) {
  return request({
    url: `/arpa-basic-api/invoiceMessage`,
    method: 'get',
    params: query
  })
}

// 新增 发票详情
export function addInvoiceInfo(data) {
  return request({
    url: '/arpa-basic-api/invoiceMessage',
    method: 'post',
    params: data
  })
}

// 获取 发票详情
export function getInvoiceInfo(code) {
  return request({
    url: `/arpa-basic-api/invoiceMessage/${code}`,
    method: 'get'
  })
}

// 更新 发票详情
export function editInvoiceInfo(data) {
  return request({
    url: '/arpa-basic-api/invoiceMessage',
    method: 'put',
    params: data
  })
}

// 删除 指定发票
export function delInvoiceInfo(data) {
  return request({
    url: '/arpa-basic-api/invoiceMessage',
    method: 'delete',
    params: data
  })
}

// 获取 入驻商/企业详情（入驻商/企业账户登录）
export function getSelfShipperInfo() {
  return request({
    url: '/arpa-basic-api/shipment/shipmentInfo',
    method: 'get'
  })
}

// 获取/查询 地址列表
export function getCommonRouteInfoList(query) {
  return request({
    url: '/arpa-basic-api/commonRouteInfo',
    method: 'get',
    params: query
  })
}

// 新增 地址详情
export function addCommonRouteInfo(query) {
  return request({
    url: '/arpa-basic-api/commonRouteInfo',
    method: 'post',
    params: query
  })
}

// 获取 地址详情
export function getCommonRouteInfo(code) {
  return request({
    url: `/arpa-basic-api/commonRouteInfo/${code}`,
    method: 'get'
  })
}

// 更新 地址详情
export function updateCommonRouteInfo(data) {
  return request({
    url: `/arpa-basic-api/commonRouteInfo/`,
    method: 'put',
    params: data
  })
}

// 删除 指定地址
export function delCommonRouteInfo(data) {
  return request({
    url: '/arpa-basic-api/commonRouteInfo',
    method: 'delete',
    params: data
  })
}

// 获取/查询 分组（主表）列表
export function getVehicleTeamList(query) {
  return request({
    url: '/arpa-basic-api/vehicleTeam',
    method: 'get',
    params: query
  })
}

// 删除 指定分组（主表）
export function delVehicleTeam(query) {
  return request({
    url: '/arpa-basic-api/vehicleTeam/batchDelTeam',
    method: 'delete',
    params: query
  })
}

// 模糊查询 司机列表
export function getInviteDriverList(query) {
  return request({
    url: '/arpa-basic-api/driver',
    method: 'get',
    params: query
  })
}

// 模糊查询 司机列表(支持查询独立司机，车队，独立司机+车队)
export function getDriverList(query) {
  return request({
    url: '/arpa-basic-api/driver/driverList',
    method: 'get',
    params: query
  })
}

// 新增/更新 分组详情
export function addOrUpdateVehicleTeam(query) {
  return request({
    url: '/arpa-basic-api/vehicleTeam/shipment',
    method: 'post',
    params: query
  })
}

// 获取 分组详情
export function getVehicleTeamDetail(query) {
  return request({
    url: `/ntocc-tms-api/acceptVehicle`,
    method: 'get',
    params: query
  })
}

// 新增 员工详情
export function addShipmentStaff(query) {
  return request({
    url: `/arpa-basic-api/shipment/staff`,
    method: 'post',
    params: query
  })
}

// 更新 员工详情
export function updateShipmentStaff(data) {
  return request({
    url: `/arpa-basic-api/shipment/staff`,
    method: 'put',
    params: data
  })
}

// 获取/查询 上游客户列表
export function getUpstreamCustomerList(query) {
  return request({
    url: '/arpa-basic-api/upstreamCustomer',
    method: 'get',
    params: query
  })
}

// 新增 上游客户详情
export function addUpstreamCustomer(query) {
  return request({
    url: `/arpa-basic-api/upstreamCustomer/`,
    method: 'post',
    params: query
  })
}

// 获取 上游客户详情
export function getUpstreamCustomer(code) {
  return request({
    url: `/arpa-basic-api/upstreamCustomer/${code}`,
    method: 'get'
  })
}

// 更新 上游客户详情
export function updateUpstreamCustomer(data) {
  return request({
    url: `/arpa-basic-api/upstreamCustomer/`,
    method: 'put',
    params: data
  })
}

// 删除 指定上游客户
export function delUpstreamCustomer(data) {
  return request({
    url: '/arpa-basic-api/upstreamCustomer',
    method: 'delete',
    params: data
  })
}

// 托运方审核
export function shipperReview(data) {
  return request({
    url: '/arpa-basic-api/shipment/auth',
    method: 'put',
    params: data
  })
}

// 获取/查询 线路管理列表
export function getShipmentLineList(query) {
  return request({
    url: `/arpa-basic-api/shipmentLine`,
    method: 'get',
    params: query
  })
}

// 删除 线路
export function delShipmentLineInfo(data) {
  return request({
    url: `/arpa-basic-api/shipmentLine/delete`,
    method: 'delete',
    params: data
  })
}

// 新增 线路
export function addShipmentLine(query) {
  return request({
    url: `/arpa-basic-api/shipmentLine/`,
    method: 'post',
    params: query
  })
}

// 修改 线路
export function editShipmentLine(query) {
  return request({
    url: `/arpa-basic-api/shipmentLine/`,
    method: 'put',
    params: query
  })
}

// 删除 线路区域
export function delShipmentLineArea(data) {
  return request({
    url: `/arpa-basic-api/shipmentLineArea/delete`,
    method: 'delete',
    params: data
  })
}

// 线路区域 移动排序
export function sequenceShipmentLineArea(data) {
  return request({
    url: `/arpa-basic-api/shipmentLineArea/sequence`,
    method: 'post',
    params: data
  })
}

// 线路区域 添加
export function addShipmentLineArea(data) {
  return request({
    url: `/arpa-basic-api/shipmentLineArea`,
    method: 'post',
    params: data
  })
}
